<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
     <title>已发送信箱</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<LINK TYPE="text/css" REL="stylesheet" HREF="${pageContext.request.contextPath}/style/blue/pageCommon.css" />
	
  
   
</head>

<body>
  <DIV ID="Title_bar">
			<DIV ID="Title_bar_Head">
				<DIV ID="Title_Head"></DIV>
				<DIV ID="Title">
					<!--页面标题-->
					<IMG BORDER="0" WIDTH="13" HEIGHT="13" SRC="${pageContext.request.contextPath}/style/images/title_arrow.gif" />
					发信箱
				</DIV>
				<DIV ID="Title_End"></DIV>
			</DIV>
		</DIV>
<div ID="MainArea">
	    <s:form action="Messages_receive" theme="simple">
	<table border="2" width="100%" ID="MainArea">
     <tr><td colspan="7">标题：<s:textfield label="标题" name="messages.title"/>
    	级别：<s:select label="级别" list="#{true:'重要',false:'普通'}"  name="messages.priorty" />
    	<s:submit value="查询" action="Messages_queryBySend"/></td>
    </tr>
    <tr ID="TableTitle">
    	<td>标题</td><td>级别</td><td>发送人</td><td>接收人</td><td>内容</td><td>发送时间</td><td>操作</td>
    </tr>
            <s:iterator value="meList" var="mes">
            <tr  CLASS="dataContainer">
            	<td><s:property value="#mes.title"/></td>
            	<td><s:if test="#mes.priorty">重要</s:if><s:else>普通</s:else></td>
            	<td><s:property value="#mes.sender.getUsertrueName()"/></td>
            	<td><s:property value="#mes.receiver.getUsertrueName()"/></td>
            	<td><s:property value="#mes.contents"/></td>
            	<td><s:property value="#mes.sendTime"/></td>
            	<td>
            		<s:a action="Messages_look" name="lookMes" ><s:param name="messageId" value="#mes.messageId"/>查看详细</s:a>
            		<s:a onClick="return confirm('是否要删除？');" action="Messages_deleteSend" name="delMes" ><s:param name="messageId" value="#mes.messageId"/>删除</s:a>
            		<s:a action="Messages_sendBySends" name="editmes"><s:param name ="messageId" value="#mes.messageId"/>重新发送</s:a>
            	</td>
            </tr>
            </s:iterator>
             <tr>
		    <td colspan="8" align="center">
		    <pg:pager scope="request" maxIndexPages="10" index="center" url="Messages_send" items="${cus.total}" export="currentPageNumber=pageNumber">   
		        <pg:first>   
		            <a href="${pageUrl}">首页</a>   
		        </pg:first>   
		        <pg:prev>   
		            <a href="${pageUrl }">上一页</a>   
		        </pg:prev>   
		        <pg:pages>   
		            <c:choose>   
		                <c:when test="${currentPageNumber eq pageNumber}">   
		                    <font color="red">${pageNumber }</font>   
		                </c:when>   
		                <c:otherwise>   
		                    <a href="${pageUrl }">${pageNumber }</a>   
		                </c:otherwise>   
		            </c:choose>   
		        </pg:pages>   
		        <pg:next>   
		            <a href="${pageUrl }">下一页</a>   
		        </pg:next>   
		        <pg:last>   
		            <a href="${pageUrl }">尾页</a>   
		        </pg:last>   
		    </pg:pager>
		    </td>
		    </tr>
            </table>
            </s:form>
</div>
  </body>
</html>
